The present invention relates generally to the presentation of computer graphics. Particularly, the present invention relates to the dynamic anti-aliasing of computer graphics.
Anti-aliasing on a display device, such as a computer monitor or printer where the display surface is divided into a rectangular array of pixels, solves the problems inherent with drawing lines and curves. Anytime a line changes direction, a jagged stair-step pattern occurs.
A typical prior art jagged edge of a letter is illustrated in FIG. 1. This figures shows that as the bottom of the xe2x80x9cJxe2x80x9d curves upward, the square pixels produce a jagged appearance. This problem can be reduced with fonts by using an anti-aliasing process on the font.
Anti-aliasing works by blending foreground and background colors near jagged edges. This xe2x80x9csoftensxe2x80x9d the edges of the font when the lines change direction. FIG. 2 illustrates a typical prior art anti-aliasing of a font. In this figure, it can be seen that the black text color is xe2x80x9caveragedxe2x80x9d with the background color to reduce the appearance of the jagged edge.
The anti-aliasing color that was generated for FIG. 2 is embedded in the graphic description and becomes part of the color description information for that graphic. When the graphic is moved to another background, the same anti-aliasing colors are used. If the background is comprised of a color or colors that are different than the original color, the edges of the graphic will not blend well with the new background color and the graphic may end up with an undesirable appearance along the edges. There is a resulting need for a process for anti-aliasing a graphic that enables the graphic to be moved to various background colors without affecting the appearance of the graphic.
The present invention encompasses a method and apparatus for anti-aliasing a graphic image. An image layer is generated for the graphic image, the image layer comprising a plurality of pixels, each pixel including a red, a green, and a blue component. An opacity value is assigned to each pixel of the plurality of pixels in order to generate an alpha channel layer. The alpha channel layer is stored with the image layer.